#ifndef _MONO_BEHAVIOUR_H_
#define _MONO_BEHAVIOUR_H_

#include <map>
#include "Component.h"

struct Coroutine
{
	void* p;
};

struct MethodParam
{
	char* Name;
	unsigned char ParamCount;
};

class MonoBehaviour : public Component
{

__DeclareSubClass(MonoBehaviour,Component);     
public:
	MonoBehaviour();
	~MonoBehaviour();
	enum 
	{
		MethodReset,//	
		MethodStart,//	
		MethodUpdate,//	
		MethodAwake,//	Awake is called when the script instance is being loaded.
		MethodFixedUpdate,//	This function is called every fixed framerate frame, if the MonoBehaviour is enabled.
		MaxFixedMethod,
	};
    
	void Init(const char* className);
	void Invoke(int index);
	void Invoke(const char* methodName);
	void Start();
	void Reset();
    void Awake();
	void Update(float delta);
	

private:
	float mFixedFrame;
	float mCurFrame;
	std::map<std::string,MonoMethod*> mMethod;
	MonoMethod* mFixedMethod[MaxFixedMethod];
 


};





#endif